package com.iss.ssm0531.dao;

import com.iss.ssm0531.model.Role;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface RoleDAO {


    @Select("select * from role where role_id=#{roleId}")
    @Results(value = {
            @Result(column = "role_name",property = "roleName"),
            @Result(column = "role_id",property = "userList",many = @Many(select="com.iss.ssm0531.dao.UserDAO.selectByRoleId"))
    })
    Role selectByPrimaryKey(Integer roleId);


}